/*
 *
 *    Copyright (c) 2021 Project CHIP Authors
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

// THIS FILE IS GENERATED BY ZAP
#import <Foundation/Foundation.h>

#import "CHIPCallbackBridge_internal.h"
#import "CHIPCluster_internal.h"
#import "CHIPDevice.h"
#import "CHIPDevice_Internal.h"
#import "CHIPListUtils_internal.h"

#import "zap-generated/CHIPTestClustersObjc.h"
#import "zap-generated/tests/CHIPClustersTest.h"

#include <type_traits>

using chip::Callback::Callback;
using chip::Callback::Cancelable;
using namespace chip::app::Clusters;

@interface CHIPTestAccessControl ()
@property (readonly) chip::Controller::AccessControlClusterTest cppCluster;
@end

@implementation CHIPTestAccessControl

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AccessControl::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AccessControl::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestAccountLogin ()
@property (readonly) chip::Controller::AccountLoginClusterTest cppCluster;
@end

@implementation CHIPTestAccountLogin

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AccountLogin::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AccountLogin::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestAdministratorCommissioning ()
@property (readonly) chip::Controller::AdministratorCommissioningClusterTest cppCluster;
@end

@implementation CHIPTestAdministratorCommissioning

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeWindowStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AdministratorCommissioning::Attributes::WindowStatus::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAdminFabricIndexWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AdministratorCommissioning::Attributes::AdminFabricIndex::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAdminVendorIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AdministratorCommissioning::Attributes::AdminVendorId::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AdministratorCommissioning::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AdministratorCommissioning::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestApplicationBasic ()
@property (readonly) chip::Controller::ApplicationBasicClusterTest cppCluster;
@end

@implementation CHIPTestApplicationBasic

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeVendorNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ApplicationBasic::Attributes::VendorName::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeVendorIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ApplicationBasic::Attributes::VendorId::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeApplicationNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ApplicationBasic::Attributes::ApplicationName::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeProductIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ApplicationBasic::Attributes::ProductId::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeApplicationStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ApplicationBasic::Attributes::ApplicationStatus::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = static_cast<std::remove_reference_t<decltype(cppValue)>>(value.unsignedCharValue);
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeApplicationVersionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ApplicationBasic::Attributes::ApplicationVersion::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAllowedVendorListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ApplicationBasic::Attributes::AllowedVendorList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0])>>(
                            element_0.unsignedShortValue);
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ApplicationBasic::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ApplicationBasic::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestApplicationLauncher ()
@property (readonly) chip::Controller::ApplicationLauncherClusterTest cppCluster;
@end

@implementation CHIPTestApplicationLauncher

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeApplicationLauncherListWithValue:(NSArray * _Nonnull)value
                                     completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ApplicationLauncher::Attributes::ApplicationLauncherList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedShortValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ApplicationLauncher::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ApplicationLauncher::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestAudioOutput ()
@property (readonly) chip::Controller::AudioOutputClusterTest cppCluster;
@end

@implementation CHIPTestAudioOutput

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeAudioOutputListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AudioOutput::Attributes::AudioOutputList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPAudioOutputClusterOutputInfo class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPAudioOutputClusterOutputInfo *) value[i_0];
                        listHolder_0->mList[i_0].index = element_0.index.unsignedCharValue;
                        listHolder_0->mList[i_0].outputType
                            = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0].outputType)>>(
                                element_0.outputType.unsignedCharValue);
                        listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name];
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentAudioOutputWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AudioOutput::Attributes::CurrentAudioOutput::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AudioOutput::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = AudioOutput::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestBarrierControl ()
@property (readonly) chip::Controller::BarrierControlClusterTest cppCluster;
@end

@implementation CHIPTestBarrierControl

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeBarrierMovingStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BarrierControl::Attributes::BarrierMovingState::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeBarrierSafetyStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BarrierControl::Attributes::BarrierSafetyStatus::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeBarrierCapabilitiesWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BarrierControl::Attributes::BarrierCapabilities::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeBarrierPositionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BarrierControl::Attributes::BarrierPosition::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BarrierControl::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BarrierControl::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestBasic ()
@property (readonly) chip::Controller::BasicClusterTest cppCluster;
@end

@implementation CHIPTestBasic

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeInteractionModelVersionWithValue:(NSNumber * _Nonnull)value
                                     completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::InteractionModelVersion::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeVendorNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::VendorName::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeVendorIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::VendorID::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeProductNameWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::ProductName::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeProductIDWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::ProductID::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeHardwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::HardwareVersion::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeHardwareVersionStringWithValue:(NSString * _Nonnull)value
                                   completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::HardwareVersionString::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSoftwareVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::SoftwareVersion::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSoftwareVersionStringWithValue:(NSString * _Nonnull)value
                                   completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::SoftwareVersionString::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeManufacturingDateWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::ManufacturingDate::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePartNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::PartNumber::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeProductURLWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::ProductURL::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeProductLabelWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::ProductLabel::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSerialNumberWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::SerialNumber::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeReachableWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::Reachable::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.boolValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeUniqueIDWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::UniqueID::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Basic::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestBinaryInputBasic ()
@property (readonly) chip::Controller::BinaryInputBasicClusterTest cppCluster;
@end

@implementation CHIPTestBinaryInputBasic

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeStatusFlagsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BinaryInputBasic::Attributes::StatusFlags::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BinaryInputBasic::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BinaryInputBasic::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestBinding ()
@property (readonly) chip::Controller::BindingClusterTest cppCluster;
@end

@implementation CHIPTestBinding

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Binding::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Binding::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestBooleanState ()
@property (readonly) chip::Controller::BooleanStateClusterTest cppCluster;
@end

@implementation CHIPTestBooleanState

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeStateValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BooleanState::Attributes::StateValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.boolValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BooleanState::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BooleanState::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestBridgedActions ()
@property (readonly) chip::Controller::BridgedActionsClusterTest cppCluster;
@end

@implementation CHIPTestBridgedActions

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeActionListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BridgedActions::Attributes::ActionList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPBridgedActionsClusterActionStruct class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPBridgedActionsClusterActionStruct *) value[i_0];
                        listHolder_0->mList[i_0].actionID = element_0.actionID.unsignedShortValue;
                        listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name];
                        listHolder_0->mList[i_0].type
                            = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0].type)>>(
                                element_0.type.unsignedCharValue);
                        listHolder_0->mList[i_0].endpointListID = element_0.endpointListID.unsignedShortValue;
                        listHolder_0->mList[i_0].supportedCommands = element_0.supportedCommands.unsignedShortValue;
                        listHolder_0->mList[i_0].status
                            = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0].status)>>(
                                element_0.status.unsignedCharValue);
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeEndpointListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BridgedActions::Attributes::EndpointList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPBridgedActionsClusterEndpointListStruct class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPBridgedActionsClusterEndpointListStruct *) value[i_0];
                        listHolder_0->mList[i_0].endpointListID = element_0.endpointListID.unsignedShortValue;
                        listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name];
                        listHolder_0->mList[i_0].type
                            = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0].type)>>(
                                element_0.type.unsignedCharValue);
                        {
                            using ListType_2 = std::remove_reference_t<decltype(listHolder_0->mList[i_0].endpoints)>;
                            using ListMemberType_2 = ListMemberTypeGetter<ListType_2>::Type;
                            if (element_0.endpoints.count != 0) {
                                auto * listHolder_2 = new ListHolder<ListMemberType_2>(element_0.endpoints.count);
                                if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) {
                                    return CHIP_ERROR_INVALID_ARGUMENT;
                                }
                                listFreer.add(listHolder_2);
                                for (size_t i_2 = 0; i_2 < element_0.endpoints.count; ++i_2) {
                                    if (![element_0.endpoints[i_2] isKindOfClass:[NSNumber class]]) {
                                        // Wrong kind of value.
                                        return CHIP_ERROR_INVALID_ARGUMENT;
                                    }
                                    auto element_2 = (NSNumber *) element_0.endpoints[i_2];
                                    listHolder_2->mList[i_2] = element_2.unsignedShortValue;
                                }
                                listHolder_0->mList[i_0].endpoints = ListType_2(listHolder_2->mList, element_0.endpoints.count);
                            } else {
                                listHolder_0->mList[i_0].endpoints = ListType_2();
                            }
                        }
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSetupUrlWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BridgedActions::Attributes::SetupUrl::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BridgedActions::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BridgedActions::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestBridgedDeviceBasic ()
@property (readonly) chip::Controller::BridgedDeviceBasicClusterTest cppCluster;
@end

@implementation CHIPTestBridgedDeviceBasic

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BridgedDeviceBasic::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = BridgedDeviceBasic::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestChannel ()
@property (readonly) chip::Controller::ChannelClusterTest cppCluster;
@end

@implementation CHIPTestChannel

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeChannelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Channel::Attributes::ChannelList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPChannelClusterChannelInfo class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPChannelClusterChannelInfo *) value[i_0];
                        listHolder_0->mList[i_0].majorNumber = element_0.majorNumber.unsignedShortValue;
                        listHolder_0->mList[i_0].minorNumber = element_0.minorNumber.unsignedShortValue;
                        listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name];
                        listHolder_0->mList[i_0].callSign = [self asCharSpan:element_0.callSign];
                        listHolder_0->mList[i_0].affiliateCallSign = [self asCharSpan:element_0.affiliateCallSign];
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Channel::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Channel::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestColorControl ()
@property (readonly) chip::Controller::ColorControlClusterTest cppCluster;
@end

@implementation CHIPTestColorControl

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeCurrentHueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::CurrentHue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentSaturationWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::CurrentSaturation::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRemainingTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::RemainingTime::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentXWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::CurrentX::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentYWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::CurrentY::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeDriftCompensationWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::DriftCompensation::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCompensationTextWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::CompensationText::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeColorTemperatureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::ColorTemperature::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeColorModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::ColorMode::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeNumberOfPrimariesWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::NumberOfPrimaries::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary1XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary1X::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary1YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary1Y::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary1IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary1Intensity::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary2XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary2X::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary2YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary2Y::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary2IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary2Intensity::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary3XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary3X::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary3YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary3Y::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary3IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary3Intensity::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary4XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary4X::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary4YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary4Y::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary4IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary4Intensity::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary5XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary5X::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary5YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary5Y::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary5IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary5Intensity::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary6XWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary6X::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary6YWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary6Y::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePrimary6IntensityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::Primary6Intensity::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeEnhancedCurrentHueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::EnhancedCurrentHue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeEnhancedColorModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::EnhancedColorMode::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeColorLoopActiveWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::ColorLoopActive::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeColorLoopDirectionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::ColorLoopDirection::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeColorLoopTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::ColorLoopTime::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeColorLoopStartEnhancedHueWithValue:(NSNumber * _Nonnull)value
                                       completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::ColorLoopStartEnhancedHue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeColorLoopStoredEnhancedHueWithValue:(NSNumber * _Nonnull)value
                                        completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::ColorLoopStoredEnhancedHue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeColorCapabilitiesWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::ColorCapabilities::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeColorTempPhysicalMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::ColorTempPhysicalMin::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeColorTempPhysicalMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::ColorTempPhysicalMax::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCoupleColorTempToLevelMinMiredsWithValue:(NSNumber * _Nonnull)value
                                             completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::CoupleColorTempToLevelMinMireds::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ColorControl::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestContentLauncher ()
@property (readonly) chip::Controller::ContentLauncherClusterTest cppCluster;
@end

@implementation CHIPTestContentLauncher

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeAcceptHeaderListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ContentLauncher::Attributes::AcceptHeaderList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSString class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSString *) value[i_0];
                        listHolder_0->mList[i_0] = [self asCharSpan:element_0];
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ContentLauncher::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ContentLauncher::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestDescriptor ()
@property (readonly) chip::Controller::DescriptorClusterTest cppCluster;
@end

@implementation CHIPTestDescriptor

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeDeviceListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Descriptor::Attributes::DeviceList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPDescriptorClusterDeviceType class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPDescriptorClusterDeviceType *) value[i_0];
                        listHolder_0->mList[i_0].type = element_0.type.unsignedIntValue;
                        listHolder_0->mList[i_0].revision = element_0.revision.unsignedShortValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeServerListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Descriptor::Attributes::ServerList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClientListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Descriptor::Attributes::ClientList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePartsListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Descriptor::Attributes::PartsList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedShortValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Descriptor::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Descriptor::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestDiagnosticLogs ()
@property (readonly) chip::Controller::DiagnosticLogsClusterTest cppCluster;
@end

@implementation CHIPTestDiagnosticLogs

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = DiagnosticLogs::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestDoorLock ()
@property (readonly) chip::Controller::DoorLockClusterTest cppCluster;
@end

@implementation CHIPTestDoorLock

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeLockStateWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = DoorLock::Attributes::LockState::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = static_cast<std::remove_reference_t<decltype(nonNullValue_0)>>(value.unsignedCharValue);
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeLockTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = DoorLock::Attributes::LockType::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = static_cast<std::remove_reference_t<decltype(cppValue)>>(value.unsignedCharValue);
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeActuatorEnabledWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = DoorLock::Attributes::ActuatorEnabled::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.boolValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeDoorStateWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = DoorLock::Attributes::DoorState::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = static_cast<std::remove_reference_t<decltype(nonNullValue_0)>>(value.unsignedCharValue);
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeNumberOfTotalUsersSupportedWithValue:(NSNumber * _Nonnull)value
                                         completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = DoorLock::Attributes::NumberOfTotalUsersSupported::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeNumberOfPINUsersSupportedWithValue:(NSNumber * _Nonnull)value
                                       completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = DoorLock::Attributes::NumberOfPINUsersSupported::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxPINCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = DoorLock::Attributes::MaxPINCodeLength::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinPINCodeLengthWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = DoorLock::Attributes::MinPINCodeLength::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSupportedOperatingModesWithValue:(NSNumber * _Nonnull)value
                                     completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = DoorLock::Attributes::SupportedOperatingModes::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = DoorLock::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = DoorLock::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestElectricalMeasurement ()
@property (readonly) chip::Controller::ElectricalMeasurementClusterTest cppCluster;
@end

@implementation CHIPTestElectricalMeasurement

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeMeasurementTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::MeasurementType::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTotalActivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::TotalActivePower::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.intValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRmsVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltage::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRmsVoltageMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMin::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRmsVoltageMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMax::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRmsCurrentWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrent::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRmsCurrentMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMin::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRmsCurrentMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMax::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeActivePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::ActivePower::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeActivePowerMinWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMin::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeActivePowerMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMax::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ElectricalMeasurement::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestEthernetNetworkDiagnostics ()
@property (readonly) chip::Controller::EthernetNetworkDiagnosticsClusterTest cppCluster;
@end

@implementation CHIPTestEthernetNetworkDiagnostics

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributePHYRateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = EthernetNetworkDiagnostics::Attributes::PHYRate::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeFullDuplexWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = EthernetNetworkDiagnostics::Attributes::FullDuplex::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.boolValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePacketRxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = EthernetNetworkDiagnostics::Attributes::PacketRxCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePacketTxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = EthernetNetworkDiagnostics::Attributes::PacketTxCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxErrCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = EthernetNetworkDiagnostics::Attributes::TxErrCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCollisionCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = EthernetNetworkDiagnostics::Attributes::CollisionCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeOverrunCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = EthernetNetworkDiagnostics::Attributes::OverrunCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCarrierDetectWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = EthernetNetworkDiagnostics::Attributes::CarrierDetect::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.boolValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTimeSinceResetWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = EthernetNetworkDiagnostics::Attributes::TimeSinceReset::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = EthernetNetworkDiagnostics::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = EthernetNetworkDiagnostics::Attributes::FeatureMap::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = EthernetNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestFixedLabel ()
@property (readonly) chip::Controller::FixedLabelClusterTest cppCluster;
@end

@implementation CHIPTestFixedLabel

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeLabelListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = FixedLabel::Attributes::LabelList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPFixedLabelClusterLabelStruct class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPFixedLabelClusterLabelStruct *) value[i_0];
                        listHolder_0->mList[i_0].label = [self asCharSpan:element_0.label];
                        listHolder_0->mList[i_0].label = [self asCharSpan:element_0.label];
                        listHolder_0->mList[i_0].value = [self asCharSpan:element_0.value];
                        listHolder_0->mList[i_0].value = [self asCharSpan:element_0.value];
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = FixedLabel::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = FixedLabel::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestFlowMeasurement ()
@property (readonly) chip::Controller::FlowMeasurementClusterTest cppCluster;
@end

@implementation CHIPTestFlowMeasurement

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = FlowMeasurement::Attributes::MeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = FlowMeasurement::Attributes::MinMeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = FlowMeasurement::Attributes::MaxMeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeToleranceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = FlowMeasurement::Attributes::Tolerance::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = FlowMeasurement::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = FlowMeasurement::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestGeneralCommissioning ()
@property (readonly) chip::Controller::GeneralCommissioningClusterTest cppCluster;
@end

@implementation CHIPTestGeneralCommissioning

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeBasicCommissioningInfoListWithValue:(NSArray * _Nonnull)value
                                        completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralCommissioning::Attributes::BasicCommissioningInfoList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPGeneralCommissioningClusterBasicCommissioningInfoType class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPGeneralCommissioningClusterBasicCommissioningInfoType *) value[i_0];
                        listHolder_0->mList[i_0].failSafeExpiryLengthMs = element_0.failSafeExpiryLengthMs.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRegulatoryConfigWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralCommissioning::Attributes::RegulatoryConfig::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeLocationCapabilityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralCommissioning::Attributes::LocationCapability::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralCommissioning::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralCommissioning::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestGeneralDiagnostics ()
@property (readonly) chip::Controller::GeneralDiagnosticsClusterTest cppCluster;
@end

@implementation CHIPTestGeneralDiagnostics

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeNetworkInterfacesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralDiagnostics::Attributes::NetworkInterfaces::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPGeneralDiagnosticsClusterNetworkInterfaceType class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPGeneralDiagnosticsClusterNetworkInterfaceType *) value[i_0];
                        listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name];
                        listHolder_0->mList[i_0].fabricConnected = element_0.fabricConnected.boolValue;
                        listHolder_0->mList[i_0].offPremiseServicesReachableIPv4
                            = element_0.offPremiseServicesReachableIPv4.boolValue;
                        listHolder_0->mList[i_0].offPremiseServicesReachableIPv6
                            = element_0.offPremiseServicesReachableIPv6.boolValue;
                        listHolder_0->mList[i_0].hardwareAddress = [self asByteSpan:element_0.hardwareAddress];
                        listHolder_0->mList[i_0].type
                            = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0].type)>>(
                                element_0.type.unsignedCharValue);
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRebootCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralDiagnostics::Attributes::RebootCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeUpTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralDiagnostics::Attributes::UpTime::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTotalOperationalHoursWithValue:(NSNumber * _Nonnull)value
                                   completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralDiagnostics::Attributes::TotalOperationalHours::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeBootReasonsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralDiagnostics::Attributes::BootReasons::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeActiveHardwareFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralDiagnostics::Attributes::ActiveHardwareFaults::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedCharValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeActiveRadioFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralDiagnostics::Attributes::ActiveRadioFaults::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedCharValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeActiveNetworkFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralDiagnostics::Attributes::ActiveNetworkFaults::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedCharValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralDiagnostics::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GeneralDiagnostics::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestGroupKeyManagement ()
@property (readonly) chip::Controller::GroupKeyManagementClusterTest cppCluster;
@end

@implementation CHIPTestGroupKeyManagement

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeGroupKeyMapWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GroupKeyManagement::Attributes::GroupKeyMap::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupKey class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPGroupKeyManagementClusterGroupKey *) value[i_0];
                        listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedShortValue;
                        listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue;
                        listHolder_0->mList[i_0].groupKeySetID = element_0.groupKeySetID.unsignedShortValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeGroupTableWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GroupKeyManagement::Attributes::GroupTable::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPGroupKeyManagementClusterGroupInfo class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPGroupKeyManagementClusterGroupInfo *) value[i_0];
                        listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedShortValue;
                        listHolder_0->mList[i_0].groupId = element_0.groupId.unsignedShortValue;
                        {
                            using ListType_2 = std::remove_reference_t<decltype(listHolder_0->mList[i_0].endpoints)>;
                            using ListMemberType_2 = ListMemberTypeGetter<ListType_2>::Type;
                            if (element_0.endpoints.count != 0) {
                                auto * listHolder_2 = new ListHolder<ListMemberType_2>(element_0.endpoints.count);
                                if (listHolder_2 == nullptr || listHolder_2->mList == nullptr) {
                                    return CHIP_ERROR_INVALID_ARGUMENT;
                                }
                                listFreer.add(listHolder_2);
                                for (size_t i_2 = 0; i_2 < element_0.endpoints.count; ++i_2) {
                                    if (![element_0.endpoints[i_2] isKindOfClass:[NSNumber class]]) {
                                        // Wrong kind of value.
                                        return CHIP_ERROR_INVALID_ARGUMENT;
                                    }
                                    auto element_2 = (NSNumber *) element_0.endpoints[i_2];
                                    listHolder_2->mList[i_2] = element_2.unsignedShortValue;
                                }
                                listHolder_0->mList[i_0].endpoints = ListType_2(listHolder_2->mList, element_0.endpoints.count);
                            } else {
                                listHolder_0->mList[i_0].endpoints = ListType_2();
                            }
                        }
                        listHolder_0->mList[i_0].groupName = [self asCharSpan:element_0.groupName];
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxGroupsPerFabricWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxGroupKeysPerFabricWithValue:(NSNumber * _Nonnull)value
                                   completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GroupKeyManagement::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = GroupKeyManagement::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestGroups ()
@property (readonly) chip::Controller::GroupsClusterTest cppCluster;
@end

@implementation CHIPTestGroups

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeNameSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Groups::Attributes::NameSupport::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Groups::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Groups::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestIdentify ()
@property (readonly) chip::Controller::IdentifyClusterTest cppCluster;
@end

@implementation CHIPTestIdentify

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeIdentifyTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Identify::Attributes::IdentifyType::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Identify::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Identify::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestIlluminanceMeasurement ()
@property (readonly) chip::Controller::IlluminanceMeasurementClusterTest cppCluster;
@end

@implementation CHIPTestIlluminanceMeasurement

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = IlluminanceMeasurement::Attributes::MeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedShortValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = IlluminanceMeasurement::Attributes::MinMeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedShortValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = IlluminanceMeasurement::Attributes::MaxMeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedShortValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeToleranceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = IlluminanceMeasurement::Attributes::Tolerance::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeLightSensorTypeWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = IlluminanceMeasurement::Attributes::LightSensorType::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedCharValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = IlluminanceMeasurement::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = IlluminanceMeasurement::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestKeypadInput ()
@property (readonly) chip::Controller::KeypadInputClusterTest cppCluster;
@end

@implementation CHIPTestKeypadInput

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = KeypadInput::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = KeypadInput::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestLevelControl ()
@property (readonly) chip::Controller::LevelControlClusterTest cppCluster;
@end

@implementation CHIPTestLevelControl

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeCurrentLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = LevelControl::Attributes::CurrentLevel::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRemainingTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = LevelControl::Attributes::RemainingTime::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = LevelControl::Attributes::MinLevel::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = LevelControl::Attributes::MaxLevel::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentFrequencyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = LevelControl::Attributes::CurrentFrequency::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinFrequencyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = LevelControl::Attributes::MinFrequency::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxFrequencyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = LevelControl::Attributes::MaxFrequency::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = LevelControl::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = LevelControl::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestLowPower ()
@property (readonly) chip::Controller::LowPowerClusterTest cppCluster;
@end

@implementation CHIPTestLowPower

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = LowPower::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = LowPower::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestMediaInput ()
@property (readonly) chip::Controller::MediaInputClusterTest cppCluster;
@end

@implementation CHIPTestMediaInput

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeMediaInputListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = MediaInput::Attributes::MediaInputList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPMediaInputClusterInputInfo class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPMediaInputClusterInputInfo *) value[i_0];
                        listHolder_0->mList[i_0].index = element_0.index.unsignedCharValue;
                        listHolder_0->mList[i_0].inputType
                            = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0].inputType)>>(
                                element_0.inputType.unsignedCharValue);
                        listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name];
                        listHolder_0->mList[i_0].description = [self asCharSpan:element_0.descriptionString];
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentMediaInputWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = MediaInput::Attributes::CurrentMediaInput::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = MediaInput::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = MediaInput::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestMediaPlayback ()
@property (readonly) chip::Controller::MediaPlaybackClusterTest cppCluster;
@end

@implementation CHIPTestMediaPlayback

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributePlaybackStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = MediaPlayback::Attributes::PlaybackState::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = static_cast<std::remove_reference_t<decltype(cppValue)>>(value.unsignedCharValue);
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeStartTimeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = MediaPlayback::Attributes::StartTime::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeDurationWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = MediaPlayback::Attributes::Duration::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePlaybackSpeedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = MediaPlayback::Attributes::PlaybackSpeed::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.floatValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSeekRangeEndWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = MediaPlayback::Attributes::SeekRangeEnd::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSeekRangeStartWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = MediaPlayback::Attributes::SeekRangeStart::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = MediaPlayback::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = MediaPlayback::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestModeSelect ()
@property (readonly) chip::Controller::ModeSelectClusterTest cppCluster;
@end

@implementation CHIPTestModeSelect

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeCurrentModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSupportedModesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ModeSelect::Attributes::SupportedModes::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPModeSelectClusterModeOptionStruct class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPModeSelectClusterModeOptionStruct *) value[i_0];
                        listHolder_0->mList[i_0].label = [self asCharSpan:element_0.label];
                        listHolder_0->mList[i_0].mode = element_0.mode.unsignedCharValue;
                        listHolder_0->mList[i_0].semanticTag = element_0.semanticTag.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ModeSelect::Attributes::StartUpMode::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ModeSelect::Attributes::Description::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ModeSelect::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ModeSelect::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestNetworkCommissioning ()
@property (readonly) chip::Controller::NetworkCommissioningClusterTest cppCluster;
@end

@implementation CHIPTestNetworkCommissioning

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeMaxNetworksWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = NetworkCommissioning::Attributes::MaxNetworks::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeNetworksWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = NetworkCommissioning::Attributes::Networks::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPNetworkCommissioningClusterNetworkInfo class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPNetworkCommissioningClusterNetworkInfo *) value[i_0];
                        listHolder_0->mList[i_0].networkID = [self asByteSpan:element_0.networkID];
                        listHolder_0->mList[i_0].connected = element_0.connected.boolValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeScanMaxTimeSecondsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = NetworkCommissioning::Attributes::ScanMaxTimeSeconds::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeConnectMaxTimeSecondsWithValue:(NSNumber * _Nonnull)value
                                   completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = NetworkCommissioning::Attributes::ConnectMaxTimeSeconds::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeLastNetworkingStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = NetworkCommissioning::Attributes::LastNetworkingStatus::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = static_cast<std::remove_reference_t<decltype(cppValue)>>(value.unsignedCharValue);
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeLastNetworkIDWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = NetworkCommissioning::Attributes::LastNetworkID::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asByteSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeLastConnectErrorValueWithValue:(NSNumber * _Nonnull)value
                                   completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = NetworkCommissioning::Attributes::LastConnectErrorValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = NetworkCommissioning::Attributes::FeatureMap::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = NetworkCommissioning::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestOtaSoftwareUpdateProvider ()
@property (readonly) chip::Controller::OtaSoftwareUpdateProviderClusterTest cppCluster;
@end

@implementation CHIPTestOtaSoftwareUpdateProvider

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OtaSoftwareUpdateProvider::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OtaSoftwareUpdateProvider::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestOtaSoftwareUpdateRequestor ()
@property (readonly) chip::Controller::OtaSoftwareUpdateRequestorClusterTest cppCluster;
@end

@implementation CHIPTestOtaSoftwareUpdateRequestor

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeUpdatePossibleWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.boolValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeUpdateStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdateState::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = static_cast<std::remove_reference_t<decltype(cppValue)>>(value.unsignedCharValue);
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeUpdateStateProgressWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedCharValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestOccupancySensing ()
@property (readonly) chip::Controller::OccupancySensingClusterTest cppCluster;
@end

@implementation CHIPTestOccupancySensing

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeOccupancyWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OccupancySensing::Attributes::Occupancy::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeOccupancySensorTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OccupancySensing::Attributes::OccupancySensorType::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeOccupancySensorTypeBitmapWithValue:(NSNumber * _Nonnull)value
                                       completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OccupancySensing::Attributes::OccupancySensorTypeBitmap::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OccupancySensing::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OccupancySensing::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestOnOff ()
@property (readonly) chip::Controller::OnOffClusterTest cppCluster;
@end

@implementation CHIPTestOnOff

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeOnOffWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OnOff::Attributes::OnOff::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.boolValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeGlobalSceneControlWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OnOff::Attributes::GlobalSceneControl::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.boolValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OnOff::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OnOff::Attributes::FeatureMap::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OnOff::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestOnOffSwitchConfiguration ()
@property (readonly) chip::Controller::OnOffSwitchConfigurationClusterTest cppCluster;
@end

@implementation CHIPTestOnOffSwitchConfiguration

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeSwitchTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OnOffSwitchConfiguration::Attributes::SwitchType::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OnOffSwitchConfiguration::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OnOffSwitchConfiguration::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestOperationalCredentials ()
@property (readonly) chip::Controller::OperationalCredentialsClusterTest cppCluster;
@end

@implementation CHIPTestOperationalCredentials

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeFabricsListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OperationalCredentials::Attributes::FabricsList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPOperationalCredentialsClusterFabricDescriptor class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPOperationalCredentialsClusterFabricDescriptor *) value[i_0];
                        listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue;
                        listHolder_0->mList[i_0].rootPublicKey = [self asByteSpan:element_0.rootPublicKey];
                        listHolder_0->mList[i_0].vendorId = element_0.vendorId.unsignedShortValue;
                        listHolder_0->mList[i_0].fabricId = element_0.fabricId.unsignedLongLongValue;
                        listHolder_0->mList[i_0].nodeId = element_0.nodeId.unsignedLongLongValue;
                        listHolder_0->mList[i_0].label = [self asCharSpan:element_0.label];
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSupportedFabricsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OperationalCredentials::Attributes::SupportedFabrics::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCommissionedFabricsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OperationalCredentials::Attributes::CommissionedFabrics::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTrustedRootCertificatesWithValue:(NSArray * _Nonnull)value
                                     completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OperationalCredentials::Attributes::TrustedRootCertificates::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSData class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSData *) value[i_0];
                        listHolder_0->mList[i_0] = [self asByteSpan:element_0];
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentFabricIndexWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OperationalCredentials::Attributes::CurrentFabricIndex::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OperationalCredentials::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = OperationalCredentials::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestPowerSource ()
@property (readonly) chip::Controller::PowerSourceClusterTest cppCluster;
@end

@implementation CHIPTestPowerSource

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSource::Attributes::Status::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeOrderWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSource::Attributes::Order::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSource::Attributes::Description::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeBatteryVoltageWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSource::Attributes::BatteryVoltage::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeBatteryPercentRemainingWithValue:(NSNumber * _Nonnull)value
                                     completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSource::Attributes::BatteryPercentRemaining::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeBatteryTimeRemainingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSource::Attributes::BatteryTimeRemaining::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeBatteryChargeLevelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSource::Attributes::BatteryChargeLevel::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeActiveBatteryFaultsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSource::Attributes::ActiveBatteryFaults::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedCharValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeBatteryChargeStateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSource::Attributes::BatteryChargeState::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSource::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSource::Attributes::FeatureMap::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSource::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestPowerSourceConfiguration ()
@property (readonly) chip::Controller::PowerSourceConfigurationClusterTest cppCluster;
@end

@implementation CHIPTestPowerSourceConfiguration

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeSourcesWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSourceConfiguration::Attributes::Sources::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedCharValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSourceConfiguration::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PowerSourceConfiguration::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestPressureMeasurement ()
@property (readonly) chip::Controller::PressureMeasurementClusterTest cppCluster;
@end

@implementation CHIPTestPressureMeasurement

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PressureMeasurement::Attributes::MeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PressureMeasurement::Attributes::MinMeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PressureMeasurement::Attributes::MaxMeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PressureMeasurement::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PressureMeasurement::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestPumpConfigurationAndControl ()
@property (readonly) chip::Controller::PumpConfigurationAndControlClusterTest cppCluster;
@end

@implementation CHIPTestPumpConfigurationAndControl

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeMaxPressureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MaxPressure::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxSpeedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MaxSpeed::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxFlowWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MaxFlow::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinConstPressureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstPressure::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxConstPressureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstPressure::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinCompPressureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MinCompPressure::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxCompPressureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MaxCompPressure::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinConstSpeedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstSpeed::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxConstSpeedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstSpeed::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinConstFlowWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstFlow::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxConstFlowWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstFlow::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinConstTempWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstTemp::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxConstTempWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstTemp::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePumpStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::PumpStatus::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeEffectiveOperationModeWithValue:(NSNumber * _Nonnull)value
                                    completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::EffectiveOperationMode::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeEffectiveControlModeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::EffectiveControlMode::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCapacityWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::Capacity::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSpeedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::Speed::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePowerWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::Power::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAlarmMaskWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::AlarmMask::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::FeatureMap::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = PumpConfigurationAndControl::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestRelativeHumidityMeasurement ()
@property (readonly) chip::Controller::RelativeHumidityMeasurementClusterTest cppCluster;
@end

@implementation CHIPTestRelativeHumidityMeasurement

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeToleranceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = RelativeHumidityMeasurement::Attributes::Tolerance::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = RelativeHumidityMeasurement::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = RelativeHumidityMeasurement::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestScenes ()
@property (readonly) chip::Controller::ScenesClusterTest cppCluster;
@end

@implementation CHIPTestScenes

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeSceneCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Scenes::Attributes::SceneCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentSceneWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Scenes::Attributes::CurrentScene::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentGroupWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Scenes::Attributes::CurrentGroup::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSceneValidWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Scenes::Attributes::SceneValid::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.boolValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeNameSupportWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Scenes::Attributes::NameSupport::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Scenes::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Scenes::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestSoftwareDiagnostics ()
@property (readonly) chip::Controller::SoftwareDiagnosticsClusterTest cppCluster;
@end

@implementation CHIPTestSoftwareDiagnostics

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeThreadMetricsWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = SoftwareDiagnostics::Attributes::ThreadMetrics::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPSoftwareDiagnosticsClusterThreadMetrics class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPSoftwareDiagnosticsClusterThreadMetrics *) value[i_0];
                        listHolder_0->mList[i_0].id = element_0.id.unsignedLongLongValue;
                        listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name];
                        listHolder_0->mList[i_0].stackFreeCurrent = element_0.stackFreeCurrent.unsignedIntValue;
                        listHolder_0->mList[i_0].stackFreeMinimum = element_0.stackFreeMinimum.unsignedIntValue;
                        listHolder_0->mList[i_0].stackSize = element_0.stackSize.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentHeapFreeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = SoftwareDiagnostics::Attributes::CurrentHeapFree::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentHeapUsedWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = SoftwareDiagnostics::Attributes::CurrentHeapUsed::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentHeapHighWatermarkWithValue:(NSNumber * _Nonnull)value
                                      completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = SoftwareDiagnostics::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = SoftwareDiagnostics::Attributes::FeatureMap::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = SoftwareDiagnostics::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestSwitch ()
@property (readonly) chip::Controller::SwitchClusterTest cppCluster;
@end

@implementation CHIPTestSwitch

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeNumberOfPositionsWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Switch::Attributes::NumberOfPositions::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentPositionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Switch::Attributes::CurrentPosition::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMultiPressMaxWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Switch::Attributes::MultiPressMax::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Switch::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Switch::Attributes::FeatureMap::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Switch::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestTargetNavigator ()
@property (readonly) chip::Controller::TargetNavigatorClusterTest cppCluster;
@end

@implementation CHIPTestTargetNavigator

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeTargetNavigatorListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TargetNavigator::Attributes::TargetNavigatorList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPTargetNavigatorClusterTargetInfo class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPTargetNavigatorClusterTargetInfo *) value[i_0];
                        listHolder_0->mList[i_0].identifier = element_0.identifier.unsignedCharValue;
                        listHolder_0->mList[i_0].name = [self asCharSpan:element_0.name];
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentNavigatorTargetWithValue:(NSNumber * _Nonnull)value
                                    completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TargetNavigator::Attributes::CurrentNavigatorTarget::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TargetNavigator::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TargetNavigator::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestTemperatureMeasurement ()
@property (readonly) chip::Controller::TemperatureMeasurementClusterTest cppCluster;
@end

@implementation CHIPTestTemperatureMeasurement

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMinMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMaxMeasuredValueWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeToleranceWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TemperatureMeasurement::Attributes::Tolerance::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TemperatureMeasurement::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TemperatureMeasurement::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestTestCluster ()
@property (readonly) chip::Controller::TestClusterClusterTest cppCluster;
@end

@implementation CHIPTestTestCluster

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeListNullablesAndOptionalsStructWithValue:(NSArray * _Nonnull)value
                                             completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TestCluster::Attributes::ListNullablesAndOptionalsStruct::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPTestClusterClusterNullablesAndOptionalsStruct class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPTestClusterClusterNullablesAndOptionalsStruct *) value[i_0];
                        if (element_0.nullableInt == nil) {
                            listHolder_0->mList[i_0].nullableInt.SetNull();
                        } else {
                            auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableInt.SetNonNull();
                            nonNullValue_2 = element_0.nullableInt.unsignedShortValue;
                        }
                        if (element_0.optionalInt != nil) {
                            auto & definedValue_2 = listHolder_0->mList[i_0].optionalInt.Emplace();
                            definedValue_2 = element_0.optionalInt.unsignedShortValue;
                        }
                        if (element_0.nullableOptionalInt != nil) {
                            auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalInt.Emplace();
                            if (element_0.nullableOptionalInt == nil) {
                                definedValue_2.SetNull();
                            } else {
                                auto & nonNullValue_3 = definedValue_2.SetNonNull();
                                nonNullValue_3 = element_0.nullableOptionalInt.unsignedShortValue;
                            }
                        }
                        if (element_0.nullableString == nil) {
                            listHolder_0->mList[i_0].nullableString.SetNull();
                        } else {
                            auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableString.SetNonNull();
                            nonNullValue_2 = [self asCharSpan:element_0.nullableString];
                        }
                        if (element_0.optionalString != nil) {
                            auto & definedValue_2 = listHolder_0->mList[i_0].optionalString.Emplace();
                            definedValue_2 = [self asCharSpan:element_0.optionalString];
                        }
                        if (element_0.nullableOptionalString != nil) {
                            auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalString.Emplace();
                            if (element_0.nullableOptionalString == nil) {
                                definedValue_2.SetNull();
                            } else {
                                auto & nonNullValue_3 = definedValue_2.SetNonNull();
                                nonNullValue_3 = [self asCharSpan:element_0.nullableOptionalString];
                            }
                        }
                        if (element_0.nullableStruct == nil) {
                            listHolder_0->mList[i_0].nullableStruct.SetNull();
                        } else {
                            auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableStruct.SetNonNull();
                            nonNullValue_2.a = element_0.nullableStruct.a.unsignedCharValue;
                            nonNullValue_2.b = element_0.nullableStruct.b.boolValue;
                            nonNullValue_2.c = static_cast<std::remove_reference_t<decltype(nonNullValue_2.c)>>(
                                element_0.nullableStruct.c.unsignedCharValue);
                            nonNullValue_2.d = [self asByteSpan:element_0.nullableStruct.d];
                            nonNullValue_2.e = [self asCharSpan:element_0.nullableStruct.e];
                            nonNullValue_2.f = static_cast<std::remove_reference_t<decltype(nonNullValue_2.f)>>(
                                element_0.nullableStruct.f.unsignedCharValue);
                            nonNullValue_2.g = element_0.nullableStruct.g.floatValue;
                            nonNullValue_2.h = element_0.nullableStruct.h.doubleValue;
                        }
                        if (element_0.optionalStruct != nil) {
                            auto & definedValue_2 = listHolder_0->mList[i_0].optionalStruct.Emplace();
                            definedValue_2.a = element_0.optionalStruct.a.unsignedCharValue;
                            definedValue_2.b = element_0.optionalStruct.b.boolValue;
                            definedValue_2.c = static_cast<std::remove_reference_t<decltype(definedValue_2.c)>>(
                                element_0.optionalStruct.c.unsignedCharValue);
                            definedValue_2.d = [self asByteSpan:element_0.optionalStruct.d];
                            definedValue_2.e = [self asCharSpan:element_0.optionalStruct.e];
                            definedValue_2.f = static_cast<std::remove_reference_t<decltype(definedValue_2.f)>>(
                                element_0.optionalStruct.f.unsignedCharValue);
                            definedValue_2.g = element_0.optionalStruct.g.floatValue;
                            definedValue_2.h = element_0.optionalStruct.h.doubleValue;
                        }
                        if (element_0.nullableOptionalStruct != nil) {
                            auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalStruct.Emplace();
                            if (element_0.nullableOptionalStruct == nil) {
                                definedValue_2.SetNull();
                            } else {
                                auto & nonNullValue_3 = definedValue_2.SetNonNull();
                                nonNullValue_3.a = element_0.nullableOptionalStruct.a.unsignedCharValue;
                                nonNullValue_3.b = element_0.nullableOptionalStruct.b.boolValue;
                                nonNullValue_3.c = static_cast<std::remove_reference_t<decltype(nonNullValue_3.c)>>(
                                    element_0.nullableOptionalStruct.c.unsignedCharValue);
                                nonNullValue_3.d = [self asByteSpan:element_0.nullableOptionalStruct.d];
                                nonNullValue_3.e = [self asCharSpan:element_0.nullableOptionalStruct.e];
                                nonNullValue_3.f = static_cast<std::remove_reference_t<decltype(nonNullValue_3.f)>>(
                                    element_0.nullableOptionalStruct.f.unsignedCharValue);
                                nonNullValue_3.g = element_0.nullableOptionalStruct.g.floatValue;
                                nonNullValue_3.h = element_0.nullableOptionalStruct.h.doubleValue;
                            }
                        }
                        if (element_0.nullableList == nil) {
                            listHolder_0->mList[i_0].nullableList.SetNull();
                        } else {
                            auto & nonNullValue_2 = listHolder_0->mList[i_0].nullableList.SetNonNull();
                            {
                                using ListType_3 = std::remove_reference_t<decltype(nonNullValue_2)>;
                                using ListMemberType_3 = ListMemberTypeGetter<ListType_3>::Type;
                                if (element_0.nullableList.count != 0) {
                                    auto * listHolder_3 = new ListHolder<ListMemberType_3>(element_0.nullableList.count);
                                    if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) {
                                        return CHIP_ERROR_INVALID_ARGUMENT;
                                    }
                                    listFreer.add(listHolder_3);
                                    for (size_t i_3 = 0; i_3 < element_0.nullableList.count; ++i_3) {
                                        if (![element_0.nullableList[i_3] isKindOfClass:[NSNumber class]]) {
                                            // Wrong kind of value.
                                            return CHIP_ERROR_INVALID_ARGUMENT;
                                        }
                                        auto element_3 = (NSNumber *) element_0.nullableList[i_3];
                                        listHolder_3->mList[i_3]
                                            = static_cast<std::remove_reference_t<decltype(listHolder_3->mList[i_3])>>(
                                                element_3.unsignedCharValue);
                                    }
                                    nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.nullableList.count);
                                } else {
                                    nonNullValue_2 = ListType_3();
                                }
                            }
                        }
                        if (element_0.optionalList != nil) {
                            auto & definedValue_2 = listHolder_0->mList[i_0].optionalList.Emplace();
                            {
                                using ListType_3 = std::remove_reference_t<decltype(definedValue_2)>;
                                using ListMemberType_3 = ListMemberTypeGetter<ListType_3>::Type;
                                if (element_0.optionalList.count != 0) {
                                    auto * listHolder_3 = new ListHolder<ListMemberType_3>(element_0.optionalList.count);
                                    if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) {
                                        return CHIP_ERROR_INVALID_ARGUMENT;
                                    }
                                    listFreer.add(listHolder_3);
                                    for (size_t i_3 = 0; i_3 < element_0.optionalList.count; ++i_3) {
                                        if (![element_0.optionalList[i_3] isKindOfClass:[NSNumber class]]) {
                                            // Wrong kind of value.
                                            return CHIP_ERROR_INVALID_ARGUMENT;
                                        }
                                        auto element_3 = (NSNumber *) element_0.optionalList[i_3];
                                        listHolder_3->mList[i_3]
                                            = static_cast<std::remove_reference_t<decltype(listHolder_3->mList[i_3])>>(
                                                element_3.unsignedCharValue);
                                    }
                                    definedValue_2 = ListType_3(listHolder_3->mList, element_0.optionalList.count);
                                } else {
                                    definedValue_2 = ListType_3();
                                }
                            }
                        }
                        if (element_0.nullableOptionalList != nil) {
                            auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalList.Emplace();
                            if (element_0.nullableOptionalList == nil) {
                                definedValue_2.SetNull();
                            } else {
                                auto & nonNullValue_3 = definedValue_2.SetNonNull();
                                {
                                    using ListType_4 = std::remove_reference_t<decltype(nonNullValue_3)>;
                                    using ListMemberType_4 = ListMemberTypeGetter<ListType_4>::Type;
                                    if (element_0.nullableOptionalList.count != 0) {
                                        auto * listHolder_4
                                            = new ListHolder<ListMemberType_4>(element_0.nullableOptionalList.count);
                                        if (listHolder_4 == nullptr || listHolder_4->mList == nullptr) {
                                            return CHIP_ERROR_INVALID_ARGUMENT;
                                        }
                                        listFreer.add(listHolder_4);
                                        for (size_t i_4 = 0; i_4 < element_0.nullableOptionalList.count; ++i_4) {
                                            if (![element_0.nullableOptionalList[i_4] isKindOfClass:[NSNumber class]]) {
                                                // Wrong kind of value.
                                                return CHIP_ERROR_INVALID_ARGUMENT;
                                            }
                                            auto element_4 = (NSNumber *) element_0.nullableOptionalList[i_4];
                                            listHolder_4->mList[i_4]
                                                = static_cast<std::remove_reference_t<decltype(listHolder_4->mList[i_4])>>(
                                                    element_4.unsignedCharValue);
                                        }
                                        nonNullValue_3 = ListType_4(listHolder_4->mList, element_0.nullableOptionalList.count);
                                    } else {
                                        nonNullValue_3 = ListType_4();
                                    }
                                }
                            }
                        }
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeListLongOctetStringWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TestCluster::Attributes::ListLongOctetString::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSData class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSData *) value[i_0];
                        listHolder_0->mList[i_0] = [self asByteSpan:element_0];
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TestCluster::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = TestCluster::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestThermostat ()
@property (readonly) chip::Controller::ThermostatClusterTest cppCluster;
@end

@implementation CHIPTestThermostat

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeLocalTemperatureWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Thermostat::Attributes::LocalTemperature::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAbsMinHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value
                                     completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Thermostat::Attributes::AbsMinHeatSetpointLimit::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAbsMaxHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value
                                     completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Thermostat::Attributes::AbsMaxHeatSetpointLimit::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAbsMinCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value
                                     completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Thermostat::Attributes::AbsMinCoolSetpointLimit::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAbsMaxCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value
                                     completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Thermostat::Attributes::AbsMaxCoolSetpointLimit::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.shortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeStartOfWeekWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Thermostat::Attributes::StartOfWeek::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeNumberOfWeeklyTransitionsWithValue:(NSNumber * _Nonnull)value
                                       completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Thermostat::Attributes::NumberOfWeeklyTransitions::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeNumberOfDailyTransitionsWithValue:(NSNumber * _Nonnull)value
                                      completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Thermostat::Attributes::NumberOfDailyTransitions::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Thermostat::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Thermostat::Attributes::FeatureMap::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = Thermostat::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestThermostatUserInterfaceConfiguration ()
@property (readonly) chip::Controller::ThermostatUserInterfaceConfigurationClusterTest cppCluster;
@end

@implementation CHIPTestThermostatUserInterfaceConfiguration

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestThreadNetworkDiagnostics ()
@property (readonly) chip::Controller::ThreadNetworkDiagnosticsClusterTest cppCluster;
@end

@implementation CHIPTestThreadNetworkDiagnostics

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeChannelWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::Channel::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRoutingRoleWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RoutingRole::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeNetworkNameWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::NetworkName::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asByteSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePanIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::PanId::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeExtendedPanIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::ExtendedPanId::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeMeshLocalPrefixWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asByteSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeOverrunCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::OverrunCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeNeighborTableListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::NeighborTableList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPThreadNetworkDiagnosticsClusterNeighborTable class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPThreadNetworkDiagnosticsClusterNeighborTable *) value[i_0];
                        listHolder_0->mList[i_0].extAddress = element_0.extAddress.unsignedLongLongValue;
                        listHolder_0->mList[i_0].age = element_0.age.unsignedIntValue;
                        listHolder_0->mList[i_0].rloc16 = element_0.rloc16.unsignedShortValue;
                        listHolder_0->mList[i_0].linkFrameCounter = element_0.linkFrameCounter.unsignedIntValue;
                        listHolder_0->mList[i_0].mleFrameCounter = element_0.mleFrameCounter.unsignedIntValue;
                        listHolder_0->mList[i_0].lqi = element_0.lqi.unsignedCharValue;
                        listHolder_0->mList[i_0].averageRssi = element_0.averageRssi.charValue;
                        listHolder_0->mList[i_0].lastRssi = element_0.lastRssi.charValue;
                        listHolder_0->mList[i_0].frameErrorRate = element_0.frameErrorRate.unsignedCharValue;
                        listHolder_0->mList[i_0].messageErrorRate = element_0.messageErrorRate.unsignedCharValue;
                        listHolder_0->mList[i_0].rxOnWhenIdle = element_0.rxOnWhenIdle.boolValue;
                        listHolder_0->mList[i_0].fullThreadDevice = element_0.fullThreadDevice.boolValue;
                        listHolder_0->mList[i_0].fullNetworkData = element_0.fullNetworkData.boolValue;
                        listHolder_0->mList[i_0].isChild = element_0.isChild.boolValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRouteTableListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RouteTableList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPThreadNetworkDiagnosticsClusterRouteTable class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPThreadNetworkDiagnosticsClusterRouteTable *) value[i_0];
                        listHolder_0->mList[i_0].extAddress = element_0.extAddress.unsignedLongLongValue;
                        listHolder_0->mList[i_0].rloc16 = element_0.rloc16.unsignedShortValue;
                        listHolder_0->mList[i_0].routerId = element_0.routerId.unsignedCharValue;
                        listHolder_0->mList[i_0].nextHop = element_0.nextHop.unsignedCharValue;
                        listHolder_0->mList[i_0].pathCost = element_0.pathCost.unsignedCharValue;
                        listHolder_0->mList[i_0].LQIIn = element_0.lqiIn.unsignedCharValue;
                        listHolder_0->mList[i_0].LQIOut = element_0.lqiOut.unsignedCharValue;
                        listHolder_0->mList[i_0].age = element_0.age.unsignedCharValue;
                        listHolder_0->mList[i_0].allocated = element_0.allocated.boolValue;
                        listHolder_0->mList[i_0].linkEstablished = element_0.linkEstablished.boolValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePartitionIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::PartitionId::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeWeightingWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::Weighting::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeDataVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::DataVersion::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeStableDataVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::StableDataVersion::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeLeaderRouterIdWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::LeaderRouterId::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeDetachedRoleCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeChildRoleCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::ChildRoleCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRouterRoleCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RouterRoleCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeLeaderRoleCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttachAttemptCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePartitionIdChangeCountWithValue:(NSNumber * _Nonnull)value
                                    completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeBetterPartitionAttachAttemptCountWithValue:(NSNumber * _Nonnull)value
                                               completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeParentChangeCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::ParentChangeCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxTotalCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxTotalCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxUnicastCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxUnicastCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxBroadcastCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxAckRequestedCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxAckedCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxAckedCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxNoAckRequestedCountWithValue:(NSNumber * _Nonnull)value
                                   completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxDataCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxDataCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxDataPollCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxDataPollCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxBeaconCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxBeaconCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxBeaconRequestCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxOtherCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxOtherCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxRetryCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxRetryCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxDirectMaxRetryExpiryCountWithValue:(NSNumber * _Nonnull)value
                                         completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxIndirectMaxRetryExpiryCountWithValue:(NSNumber * _Nonnull)value
                                           completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxErrCcaCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxErrAbortCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTxErrBusyChannelCountWithValue:(NSNumber * _Nonnull)value
                                   completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxTotalCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxTotalCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxUnicastCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxUnicastCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxBroadcastCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxDataCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDataCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxDataPollCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDataPollCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxBeaconCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxBeaconCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxBeaconRequestCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxOtherCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxOtherCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxAddressFilteredCountWithValue:(NSNumber * _Nonnull)value
                                    completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxDestAddrFilteredCountWithValue:(NSNumber * _Nonnull)value
                                     completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxDuplicatedCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxErrNoFrameCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxErrUnknownNeighborCountWithValue:(NSNumber * _Nonnull)value
                                       completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxErrInvalidSrcAddrCountWithValue:(NSNumber * _Nonnull)value
                                      completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxErrSecCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrSecCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxErrFcsCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRxErrOtherCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeActiveTimestampWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePendingTimestampWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::PendingTimestamp::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeDelayWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::Delay::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSecurityPolicyWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::SecurityPolicy::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPThreadNetworkDiagnosticsClusterSecurityPolicy class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPThreadNetworkDiagnosticsClusterSecurityPolicy *) value[i_0];
                        listHolder_0->mList[i_0].rotationTime = element_0.rotationTime.unsignedShortValue;
                        listHolder_0->mList[i_0].flags = element_0.flags.unsignedShortValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeChannelMaskWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::ChannelMask::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asByteSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeOperationalDatasetComponentsWithValue:(NSArray * _Nonnull)value
                                          completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::OperationalDatasetComponents::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[CHIPThreadNetworkDiagnosticsClusterOperationalDatasetComponents class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (CHIPThreadNetworkDiagnosticsClusterOperationalDatasetComponents *) value[i_0];
                        listHolder_0->mList[i_0].activeTimestampPresent = element_0.activeTimestampPresent.boolValue;
                        listHolder_0->mList[i_0].pendingTimestampPresent = element_0.pendingTimestampPresent.boolValue;
                        listHolder_0->mList[i_0].masterKeyPresent = element_0.masterKeyPresent.boolValue;
                        listHolder_0->mList[i_0].networkNamePresent = element_0.networkNamePresent.boolValue;
                        listHolder_0->mList[i_0].extendedPanIdPresent = element_0.extendedPanIdPresent.boolValue;
                        listHolder_0->mList[i_0].meshLocalPrefixPresent = element_0.meshLocalPrefixPresent.boolValue;
                        listHolder_0->mList[i_0].delayPresent = element_0.delayPresent.boolValue;
                        listHolder_0->mList[i_0].panIdPresent = element_0.panIdPresent.boolValue;
                        listHolder_0->mList[i_0].channelPresent = element_0.channelPresent.boolValue;
                        listHolder_0->mList[i_0].pskcPresent = element_0.pskcPresent.boolValue;
                        listHolder_0->mList[i_0].securityPolicyPresent = element_0.securityPolicyPresent.boolValue;
                        listHolder_0->mList[i_0].channelMaskPresent = element_0.channelMaskPresent.boolValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeActiveNetworkFaultsListWithValue:(NSArray * _Nonnull)value
                                     completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0]
                            = static_cast<std::remove_reference_t<decltype(listHolder_0->mList[i_0])>>(element_0.unsignedCharValue);
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::FeatureMap::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = ThreadNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestUserLabel ()
@property (readonly) chip::Controller::UserLabelClusterTest cppCluster;
@end

@implementation CHIPTestUserLabel

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = UserLabel::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestWakeOnLan ()
@property (readonly) chip::Controller::WakeOnLanClusterTest cppCluster;
@end

@implementation CHIPTestWakeOnLan

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeWakeOnLanMacAddressWithValue:(NSString * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WakeOnLan::Attributes::WakeOnLanMacAddress::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asCharSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WakeOnLan::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WakeOnLan::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestWiFiNetworkDiagnostics ()
@property (readonly) chip::Controller::WiFiNetworkDiagnosticsClusterTest cppCluster;
@end

@implementation CHIPTestWiFiNetworkDiagnostics

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeBssidWithValue:(NSData * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::Bssid::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = [self asByteSpan:value];
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSecurityTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::SecurityType::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeWiFiVersionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::WiFiVersion::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeChannelNumberWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::ChannelNumber::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeRssiWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::Rssi::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.charValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeBeaconLostCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::BeaconLostCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeBeaconRxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::BeaconRxCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePacketMulticastRxCountWithValue:(NSNumber * _Nonnull)value
                                    completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePacketMulticastTxCountWithValue:(NSNumber * _Nonnull)value
                                    completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePacketUnicastRxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributePacketUnicastTxCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentMaxRateWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeOverrunCountWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::OverrunCount::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedLongLongValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::FeatureMap::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WiFiNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end

@interface CHIPTestWindowCovering ()
@property (readonly) chip::Controller::WindowCoveringClusterTest cppCluster;
@end

@implementation CHIPTestWindowCovering

- (chip::Controller::ClusterBase *)getCluster
{
    return &_cppCluster;
}

- (void)writeAttributeTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::Type::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentPositionLiftWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::CurrentPositionLift::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedShortValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentPositionTiltWithValue:(NSNumber * _Nullable)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::CurrentPositionTilt::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedShortValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeConfigStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::ConfigStatus::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentPositionLiftPercentageWithValue:(NSNumber * _Nullable)value
                                           completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercentage::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedCharValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentPositionTiltPercentageWithValue:(NSNumber * _Nullable)value
                                           completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercentage::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedCharValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeOperationalStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::OperationalStatus::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTargetPositionLiftPercent100thsWithValue:(NSNumber * _Nullable)value
                                             completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::TargetPositionLiftPercent100ths::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedShortValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeTargetPositionTiltPercent100thsWithValue:(NSNumber * _Nullable)value
                                             completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::TargetPositionTiltPercent100ths::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedShortValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeEndProductTypeWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::EndProductType::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedCharValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentPositionLiftPercent100thsWithValue:(NSNumber * _Nullable)value
                                              completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercent100ths::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedShortValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeCurrentPositionTiltPercent100thsWithValue:(NSNumber * _Nullable)value
                                              completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercent100ths::TypeInfo;
            TypeInfo::Type cppValue;
            if (value == nil) {
                cppValue.SetNull();
            } else {
                auto & nonNullValue_0 = cppValue.SetNonNull();
                nonNullValue_0 = value.unsignedShortValue;
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeInstalledOpenLimitLiftWithValue:(NSNumber * _Nonnull)value
                                    completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::InstalledOpenLimitLift::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeInstalledClosedLimitLiftWithValue:(NSNumber * _Nonnull)value
                                      completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::InstalledClosedLimitLift::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeInstalledOpenLimitTiltWithValue:(NSNumber * _Nonnull)value
                                    completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::InstalledOpenLimitTilt::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeInstalledClosedLimitTiltWithValue:(NSNumber * _Nonnull)value
                                      completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::InstalledClosedLimitTilt::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeSafetyStatusWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::SafetyStatus::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::AttributeList::TypeInfo;
            TypeInfo::Type cppValue;
            {
                using ListType_0 = std::remove_reference_t<decltype(cppValue)>;
                using ListMemberType_0 = ListMemberTypeGetter<ListType_0>::Type;
                if (value.count != 0) {
                    auto * listHolder_0 = new ListHolder<ListMemberType_0>(value.count);
                    if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) {
                        return CHIP_ERROR_INVALID_ARGUMENT;
                    }
                    listFreer.add(listHolder_0);
                    for (size_t i_0 = 0; i_0 < value.count; ++i_0) {
                        if (![value[i_0] isKindOfClass:[NSNumber class]]) {
                            // Wrong kind of value.
                            return CHIP_ERROR_INVALID_ARGUMENT;
                        }
                        auto element_0 = (NSNumber *) value[i_0];
                        listHolder_0->mList[i_0] = element_0.unsignedIntValue;
                    }
                    cppValue = ListType_0(listHolder_0->mList, value.count);
                } else {
                    cppValue = ListType_0();
                }
            }
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::FeatureMap::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedIntValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler
{
    new CHIPDefaultSuccessCallbackBridge(
        self.callbackQueue,
        ^(id _Nullable ignored, NSError * _Nullable error) {
            completionHandler(error);
        },
        ^(Cancelable * success, Cancelable * failure) {
            ListFreer listFreer;
            using TypeInfo = WindowCovering::Attributes::ClusterRevision::TypeInfo;
            TypeInfo::Type cppValue;
            cppValue = value.unsignedShortValue;
            auto successFn = Callback<CHIPDefaultSuccessCallbackType>::FromCancelable(success);
            auto failureFn = Callback<CHIPDefaultFailureCallbackType>::FromCancelable(failure);
            return self.cppCluster.WriteAttribute<TypeInfo>(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall);
        });
}

@end
